<template>
  <transition name="el-zoom-in-center">
    <el-scrollbar v-show="showTotle" class="bottom_from_inside" height="400px">
      <div v-loading='gkLoading' element-loading-text="正在加载管口参数..." style="position: relative;">
        <div style='position: fixed; z-index: 99;width: 86%;background-color: white;' class="header_title">
          <div :class="valueSwich
            ? 'header_title_right_switch'
            : 'header_title_right_switch_r'
            ">
            <el-switch size="large" v-model="valueSwich" class="ml-2" inline-prompt style="
                --el-switch-on-color: #13ce66;
                --el-switch-off-color: rgb(24, 144, 255);
              " active-text="参数化" inactive-text="基本体" />
          </div>
          <transition>
            <div style="display: flex" v-if="activeName !== '基本体' && activeName !== '管口' && activeName !== '预焊件'">
              <el-button :icon="Guide" @click="saveBEM" style="margin-right: 0px" size="small"
                type="success">保存设计参数</el-button>
              <el-button :icon="Coordinate" @click="calculateModel" style="margin-right: 0px" size="small"
                type="warning">模型计算与生成</el-button>
              <el-button :icon="Calendar" @click="exportdatas" style="margin-right: 0px" size="small"
                type="danger">生成BEM表格</el-button>
              <el-button :icon="Guide" @click="viewExcel" style="margin-right: 0px" size="small"
                type="success">预览管口材料</el-button>
              <el-button :icon="Coordinate" @click="createN" style="margin-right: 0px" size="small"
                type="warning">生成管口材料表</el-button>
              <div v-if='hiddenButtonShow' class="common_button2">
                <el-button type="primary" @click="addActive2" size="small">新增</el-button>

                <el-button type="success" @click='copyFn_con' size="small">复制</el-button>
              </div>
              <div v-if="showVelData" class="common_button2">


                <el-button type="success" @click="saveVelData" size="small">保存</el-button>
              </div>

            </div>
          </transition>
          <transition>
            <div style="display: flex" v-if="activeName == '基本体' || activeName == '管口' || activeName == '预焊件'">


              <el-button v-if="
                activeName == '基本体' ||
                activeName == '管口' ||
                activeName == '预焊件'
              " @click="getDataFromCenterCom" size="small" type="warning">计算设备涂漆防火面积</el-button>

              <el-button v-if="
                activeName == '基本体' ||
                activeName == '管口' ||
                activeName == '预焊件'
              " @click="getDataFromCenter" size="small" type="success" :icon="Coordinate">数据中心获取管口方位数据</el-button>



              <el-button v-if="activeName == '基本体' || activeName == '管口' || activeName == '预焊件'"
                @click="dialogEXportEquipData" style="margin-right: 10px" size="small" type="primary"
                :icon="Upload">导出</el-button>

              <el-upload :icon="Download" class="upload-demo" action="#" :show-file-list="false"
                :http-request="uploadTable">
                <el-button v-if="activeName == '基本体' || activeName == '管口' || activeName == '预焊件'"
                  style="margin-right: 10px" size="small" type="danger">导入</el-button>
              </el-upload>

              <el-button :icon="Coordinate" v-if="activeName == '基本体' || activeName == '管口' || activeName == '预焊件'"
                @click="computeder" style="margin-right: 10px" size="small" type="warning">计算生成模型</el-button>
            </div>
          </transition>
        </div>
        <div style="height: 41px"></div>
        <el-tabs v-model="activeName" type="card" class="demo-tabs22ff" @tab-click="handleClick">
          <el-tab-pane v-if="valueSwich" label="主体结构参数" name="主体结构参数">
            <transition name="el-zoom-in-top">
              <div v-show="show1">
                <el-form label-position="top" :inline="true" ref="designformRef" size="small" :model="designform"
                  label-width="120px">
                  <div class="flex_style">


                    <el-form-item label="筒体壁厚：" prop="cylinder_thick">
                      <el-input size="small" v-model="designform.cylinder_thick" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="封头壁厚：" prop="head_thick">
                      <el-input size="small" v-model="designform.head_thick" placeholder="请输入">
                      </el-input>
                    </el-form-item>




                    <el-form-item label="鞍座包角" prop="saddle_corner_radius">
                      <el-input size="small" v-model="designform.saddle_corner_radius" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="左侧鞍座距封头切线距离" prop="left_saddle_to_head_tangent_dist">
                      <el-input size="small" v-model="designform.left_saddle_to_head_tangent_dist" placeholder="请输入">
                      </el-input>
                    </el-form-item>



                  </div>
                </el-form>
              </div>
            </transition>
          </el-tab-pane>

          <el-tab-pane v-if="valueSwich" label="管口参数" name="管口参数">
            <transition name="el-zoom-in-top">
              <div v-show="show4">
                <el-tabs type="card" ref="buttonRef" v-model="activeNameInside" @tab-remove="removeTab" closable
                  tab-position="left" class="demo-tabs_ds">
                  <el-tab-pane v-if="valueSwichLoading" v-for="(item, index) in lazyLoadingData" :key="index"
                    :label="item.nozzle_name" :name="index">

                    <template #label>
                      <p style="overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis; width: 64px;">{{ item.nozzle_name }}</p>
                    </template>
                    <div class="content_tabs">
                      <div class="common_button">
                        <el-button type="primary" @click="addActive2" size="small">新增</el-button>

                        <el-button class='hiddenButton' type="success" @click="copyFn(item)" size="small">复制</el-button>
                      </div>

                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">
                            <el-form-item label="管口名称" prop="nozzle_name">
                              <el-input @change="changeName_G" size="small" v-model="item.nozzle_name"
                                placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="公称尺寸" prop="nozzle_npd">
                              <el-select style="width: 160px" v-model="item.nozzle_npd" size="small" filterable>
                                <el-option v-for="(npd, index) in nozzleInfo.nozzleNpd" :key="index" :label="npd.label"
                                  :value="npd.value" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="公称压力" prop="nozzle_rating">
                              <el-select style="width: 160px" v-model="item.nozzle_rating" size="small" filterable>
                                <el-option v-for="(
press, index
                                  ) in nozzleInfo.nozzleRating" :key="index" :label="press.label"
                                  :value="press.value" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="法兰标准" prop="nozzle_standard">
                              <el-select style="width: 160px" v-model="item.nozzle_standard" size="small" filterable>
                                <el-option v-for="(
standard, index
                                  ) in nozzleInfo.nozzleStandard" :key="index" :label="standard.label"
                                  :value="standard.value" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="法兰形式" prop="nozzle_form">
                              <el-input size="small" v-model="item.nozzle_form" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="密封面形式" prop="nozzle_preparation">
                              <el-select style="width: 160px" v-model="item.nozzle_preparation" size="small" filterable>
                                <el-option v-for="(
preparation, index
                                  ) in nozzleInfo.nozzlePreparation" :key="index" :label="preparation.label"
                                  :value="preparation.value" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="密封面至设备中心距" prop="nozzle_face_to_equip_center">
                              <el-input size="small" v-model="item.nozzle_face_to_equip_center" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="用途" prop="nozzle_purpose">
                              <el-input size="small" v-model="item.nozzle_purpose" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="壁厚等级" prop="nozzle_sch">
                              <el-select size="small" style="width: 160px" v-model="item.nozzle_sch" clearable>
                                <el-option v-for="(sch, idx) in nozzleSch" :key="idx" :label="sch.label"
                                  :value="sch.value" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="开孔处直径" prop="nozzle_open_diam">
                              <el-input style="width: 110px" class="adjustInput" id="opendiam" size="small"
                                v-model="item.nozzle_open_diam" placeholder="请输入" />
                              <el-button style="margin-left: 4px" type="primary" plain size="small"
                                @click="JCfN(item)">继承</el-button>
                            </el-form-item>

                            <el-divider>
                              <div style="font-size: 12px; color: #999">
                                分割线
                              </div>
                            </el-divider>

                            <el-form-item label="隐藏管口" prop="nozzle_ishide">
                              <el-select style="width: 160px" size="small" v-model="item.nozzle_ishide" clearable>
                                <el-option label="Y" value="Y" />
                                <el-option label="N" value="N" />
                              </el-select>
                            </el-form-item>
                            <el-form-item label="开孔位置" prop="nozzle_location">
                              <el-select style="width: 160px" v-model="item.nozzle_location" size="small">
                                <el-option v-for="(
location, index
                                  ) in nozzleInfo.nozzleLocationForNozzleMaterial" :key="index" :value="location" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="接管/补强管" prop="nozzle_connect_or_reinforcing_tube">
                              <el-select style="width: 160px" size="small" v-model="item.nozzle_connect_or_reinforcing_tube
                                " clearable>
                                <el-option label="接管" value="接管" />
                                <el-option label="补强管" value="补强管" />
                                <el-option label="钢板卷制" value="钢板卷制" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="接管壁厚/补强厚度" prop="nozzle_connect_or_reinforcing_tube_thk">
                              <el-input size="small" v-model="item.nozzle_connect_or_reinforcing_tube_thk
                                " placeholder="请输入" />
                            </el-form-item>

                            <el-form-item class="test" label="筒体开孔距支撑面距离封头开孔距封头切线距离" prop="nozzle_to_head_tangent_dis">
                              <template #label>
                                <el-tooltip class="box-item" effect="dark" content="筒体开孔距支撑面距离封头开孔距封头切线距离"
                                  placement="top-start">
                                  <div style="width: 160px">
                                    筒体开孔距支撑面距离封....
                                  </div>
                                </el-tooltip>
                              </template>
                              <el-input size="small" v-model="item.nozzle_to_head_tangent_dis" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="带法兰盖" prop="nozzle_with_blind">
                              <el-select style="width: 160px" size="small" v-model="item.nozzle_with_blind" clearable>
                                <el-option label="Y" value="Y" />
                                <el-option label="N" value="N" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="偏心距离/封头开孔圆" prop="nozzle_offset_dis">
                              <el-input size="small" v-model="item.nozzle_offset_dis" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="外伸长度(可调整用于确认补强管长度)" prop="nozzle_outside_extension_length">
                              <template #label>
                                <el-tooltip class="box-item" effect="dark" content="外伸长度(可调整用于确认补强管长度)"
                                  placement="top-start">
                                  <div style="width: 160px">外伸长度....</div>
                                </el-tooltip>
                              </template>

                              <el-input style="width: 100px" class="adjustInput" size="small"
                                v-model="item.nozzle_outside_extension_length" placeholder="请输入" />
                              <el-button type="primary" size="small" style="margin-left: 4px" plain
                                @click="CalExtensionLen(item)">计算</el-button>
                            </el-form-item>

                            <el-form-item label="法兰方位角" prop="nozzle_open_angle">
                              <el-input size="small" v-model="item.nozzle_open_angle" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="法向夹角" prop="nozzle_normal_angle">
                              <el-input size="small" v-model="item.nozzle_normal_angle" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="内伸Y/N" prop="nozzle_is_internal_extension">
                              <el-select style="width: 160px" size="small" v-model="item.nozzle_is_internal_extension"
                                clearable>
                                <el-option label="Y" value="Y" />
                                <el-option label="N" value="N" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="内伸长度" prop="nozzle_internal_extension_length">
                              <el-input size="small" v-model="item.nozzle_internal_extension_length"
                                placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="需要支撑" prop="nozzle_isneed_supp">
                              <el-select style="width: 160px" size="small" v-model="item.nozzle_isneed_supp" clearable>
                                <el-option label="Y" value="Y" />
                                <el-option label="N" value="N" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="接管材料" prop="nozzle_connect_tube_material">
                              <el-select style="width: 160px" v-model="item.nozzle_connect_tube_material" size="small">
                                <el-option v-for="(
material, idx
                                  ) in connectTubeMaterialMeta" :key="idx" :label="material.label"
                                  :value="material.label" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="外伸弯管" prop="nozzle_extended_bend">
                              <el-select style="width: 160px" size="small" v-model="item.nozzle_extended_bend"
                                clearable>
                                <el-option label="Y" value="Y" />
                                <el-option label="N" value="N" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="弯管中心距" prop="nozzle_bend_center_dis">
                              <el-input size="small" v-model="item.nozzle_bend_center_dis" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="内件" prop="nozzle_internal_components">
                              <el-select style="width: 160px" v-model="item.nozzle_internal_components" size="small">
                                <el-option v-for="(
internalComp, idx
                                  ) in internalComponentMeta" :key="idx" :label="internalComp.label"
                                  :value="internalComp.label" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="补强圈" prop="nozzle_reinforcing_ring">
                              <el-select style="width: 160px" v-model="item.nozzle_reinforcing_ring" size="small">
                                <el-option v-for="(
reinforcingRing, idx
                                  ) in reinforcingRingMeta" :key="idx" :label="reinforcingRing.label"
                                  :value="reinforcingRing.label" />
                              </el-select>
                            </el-form-item>

                            <el-form-item label="补强圈厚度" prop="nozzle_reinforcing_ring_htk">
                              <el-input size="small" v-model="item.nozzle_reinforcing_ring_htk" placeholder="请输入" />
                            </el-form-item>
                            <el-form-item label="备注" prop="nozzle_note">
                              <el-input size="small" v-model="item.nozzle_note" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item v-if="
                              item.nozzle_location.endsWith('封头') &&
                              item.nozzle_extended_bend.trim() === 'Y'
                            " label="模型用法兰定位" prop="nozzle_bend_offset_dis">
                              <el-input size="small" v-model="item.nozzle_bend_offset_dis" placeholder="请输入" />
                            </el-form-item>
                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>
                </el-tabs>
              </div>
            </transition>
          </el-tab-pane>

          <el-tab-pane v-if="valueSwich && equipInfo.equip_class.includes('容器') && equipInfo.installation_mode == '鞍座'"
            label="静设备结构安装条件表" name="静设备结构安装条件表">
            <transition>
              <div v-show="show4">
                <el-tabs type="card" ref="buttonRef" tab-position="left" class="demo-tabs_ds" v-model="activeNewName">
                  <el-tab-pane label="设备工艺参数" name="设备工艺参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        设备工艺参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">
                            <el-form-item label="管/壳程介质特性" prop="fluid_property">
                              <el-input disabled size="small" v-model="vesselData.fluid_property" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="管/壳程介质密度(kg/m3)" prop="fluid_density">
                              <el-input disabled size="small" v-model="vesselData.fluid_density" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="设计温度(℃)" prop="fluid_density">
                              <el-input disabled size="small" v-model="vesselData.design_temperature"
                                placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="公称直径DN" prop="fluid_density">
                              <el-input disabled size="small" v-model="vesselData.nominal_diam" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="设备长度L(mm)" prop="tube_length">
                              <el-input disabled size="small" v-model="vesselData.tube_length" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="保温厚度(mm)" prop="insulation_thickness">
                              <el-input disabled size="small" v-model="vesselData.insulation_thickness"
                                placeholder="请输入" />
                            </el-form-item>



                            <el-form-item label="全容积(m3)" prop="full_volume">
                              <el-input disabled size="small" v-model="vesselData.full_volume" placeholder="请输入" />
                            </el-form-item>


                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>
                  <el-tab-pane label="设备质量参数" name="设备质量参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        设备质量参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">
                            <el-form-item label="空质量" prop="equip_dry_weight">
                              <el-input disabled size="small" v-model="vesselData.equip_dry_weight" placeholder="请输入" />
                            </el-form-item>
                            <el-form-item label="净质量" prop="net_weight">
                              <el-input size="small" v-model="vesselData.net_weight" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="吊装质量" prop="lifting_weight">
                              <el-input size="small" v-model="vesselData.lifting_weight" placeholder="请输入" />
                            </el-form-item>



                            <el-form-item label="操作质量" prop="operating_weight">
                              <el-input size="small" v-model="vesselData.operating_weight" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="最大质量" prop="maximum_weight">
                              <el-input size="small" v-model="vesselData.maximum_weight" placeholder="请输入" />
                            </el-form-item>
                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>

                  <el-tab-pane label="支座参数" name="支座参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        支座参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">
                            <el-form-item class="contentMessage" label="支座型号" prop="support_type">
                              <el-select size="small" v-model="vesselData.support_type" placeholder="请输入">
                                <el-option v-for="(item, index) in [
                                  {
                                    label: 'A',
                                    value: '120,A',
                                  },
                                  {
                                    label: 'B-1',
                                    value: '120,B-1',
                                  },
                                  {
                                    label: 'B-2',
                                    value: '150,B-2',
                                  },
                                ]" :key="index" :label="item.label" :value="item.value"></el-option>
                              </el-select>
                            </el-form-item>

                            <el-form-item label="支座数量" prop="support_count">
                              <el-input size="small" v-model="vesselData.support_count" placeholder="请输入" />
                            </el-form-item>
                            <el-form-item label="支撑高度(mm)" prop="support_height">
                              <el-input size="small" v-model="vesselData.support_height" placeholder="请输入" />
                            </el-form-item>
                            <el-form-item label="支座间距(mm)" prop="support_spacing">
                              <el-input size="small" v-model="vesselData.support_spacing" placeholder="请输入" />
                            </el-form-item>
                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>

                  <el-tab-pane label="单支座螺栓参数" name="单支座螺栓参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        单支座螺栓参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">


                            <el-form-item label="材质" prop="singlesupportbolt_material">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_material"
                                placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="数量" prop="singlesupportbolt_quantity">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_quantity"
                                placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="间距l2(mm)" prop="singlesupportbolt_spacing_l2">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_spacing_l2
                                " placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="间距l4(mm)" prop="singlesupportbolt_spacing_l4">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_spacing_l4
                                " placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="规格" prop="singlesupportbolt_specification">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_specification
                                " placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="外伸长度(mm)" prop="singlesupportbolt_cantilever_length">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_cantilever_length
                                " placeholder="请输入" />
                            </el-form-item>



                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>


                  <el-tab-pane label="底板参数" name="底板参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        底板参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">


                            <el-form-item label="l1(mm)" prop="base_plate_l1">
                              <el-input size="small" v-model="vesselData.base_plate_l1" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="b1(mm)" prop="base_plate_b1">
                              <el-input size="small" v-model="vesselData.base_plate_b1" placeholder="请输入" />
                            </el-form-item>
                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>
                </el-tabs>
              </div>
            </transition>
          </el-tab-pane>

          <el-tab-pane v-if="designform.is_standardflange === '是' && valueSwich" label="非标法兰参数" name="非标法兰参数">
            <transition name="el-zoom-in-top">
              <div v-show="show5">
                <el-form label-position="top" :inline="true" ref="designformRef" size="small" :model="designform"
                  label-width="120px">
                  <div class="flex_style">
                    <el-form-item label="螺栓规格" prop="ns_bolt_size">
                      <el-input size="small" v-model="designform.ns_bolt_size" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="螺栓孔大小" prop="ns_bolthole_size">
                      <el-input size="small" v-model="designform.ns_bolthole_size" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="螺栓个数" prop="ns_bolt_count">
                      <el-input size="small" v-model="designform.ns_bolt_count" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="螺栓圆" prop="ns_boltcircle_diameter">
                      <el-input size="small" v-model="designform.ns_boltcircle_diameter" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="高度" prop="ns_flange_height">
                      <el-input size="small" v-model="designform.ns_flange_height" placeholder="请输入">
                      </el-input>
                    </el-form-item>
                    <el-form-item label="外径" prop="ns_flange_diameter">
                      <el-input size="small" v-model="designform.ns_flange_diameter" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="密封面D4" prop="ns_flange_d4">
                      <el-input size="small" v-model="designform.ns_flange_d4" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="密封面D3" prop="ns_flange_d3">
                      <el-input size="small" v-model="designform.ns_flange_d3" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="密封面D2" prop="ns_flange_d2">
                      <el-input size="small" v-model="designform.ns_flange_d2" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="法兰盘厚度" prop="ns_flange_thickness">
                      <el-input size="small" v-model="designform.ns_flange_thickness" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="锥颈高度" prop="ns_flange_neckheight">
                      <el-input size="small" v-model="designform.ns_flange_neckheight" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="大端厚度" prop="ns_flange_bside_thickness">
                      <el-input size="small" v-model="designform.ns_flange_bside_thickness" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="小端厚度" prop="ns_flange_sside_thickness">
                      <el-input size="small" v-model="designform.ns_flange_sside_thickness" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="圆角" prop="ns_flange_guideangle">
                      <el-input size="small" v-model="designform.ns_flange_guideangle" placeholder="请输入">
                      </el-input>
                    </el-form-item>
                  </div>
                </el-form>
              </div>
            </transition>
          </el-tab-pane>

          <el-tab-pane v-if="(designform.expansionjoint_requirement === '是') & valueSwich" label="膨胀节参数"
            name="expandjointParas">
            <transition name="el-zoom-in-top">
              <div v-show="show6">
                <el-form label-position="top" :inline="true" ref="designformRef" size="small" :model="designform"
                  label-width="120px">
                  <div class="flex_style">
                    <el-form-item label="距前端管板密封面距离" prop="expansionjoint_disto_front">
                      <el-input size="small" v-model="designform.expansionjoint_disto_front" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="总长" prop="expansionjoint_length">
                      <el-input size="small" v-model="designform.expansionjoint_length" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="圆弧半径" prop="expansionjoint_r">
                      <el-input size="small" v-model="designform.expansionjoint_r" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="波纹管材料层数" prop="corrugatedpipe_mat">
                      <el-input size="small" v-model="designform.corrugatedpipe_mat" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="波纹管名义厚度" prop="corrugatedpipe_thickness">
                      <el-input size="small" v-model="designform.corrugatedpipe_thickness" placeholder="请输入">
                      </el-input>
                    </el-form-item>

                    <el-form-item label="波高" prop="corrugate_height">
                      <el-input size="small" v-model="designform.corrugate_height" placeholder="请输入">
                      </el-input>
                    </el-form-item>
                  </div>
                  <!-- 第一行 -->
                </el-form>
              </div>
            </transition>
          </el-tab-pane>

          <el-tab-pane v-if="!valueSwich" label="基本体" name="基本体">
            <transition name="el-zoom-in-top">
              <div v-show="show1">
                <TableShapList :activeHeight1="activeHeight1" :primitivesData="primitivesData" @editRow='editRow'
                  @copyRow='copyRow' @moveUpRow='moveUpRow' @moveDownRow='moveDownRow' @deleteRow='deleteRow'>
                </TableShapList>
              </div>
            </transition>
          </el-tab-pane>
          <el-tab-pane v-if="!valueSwich" label="管口" name="管口">
            <transition name="el-zoom-in-top">
              <div v-show="show1">
                <TableNozzleList :activeHeight1='activeHeight1' :nozzlesData='nozzlesData'
                  :tableRowClassName='tableRowClassName' @editRownozzles='editRownozzles'
                  @copyRownozzles='copyRownozzles' @deleteRowNozzle='deleteRowNozzle'>
                </TableNozzleList>
              </div>
            </transition>
          </el-tab-pane>


          <el-tab-pane v-if="!valueSwich" label="预焊件" name="预焊件">
            <transition name="el-zoom-in-top">
              <div :style="`height:${activeHeight1}`" v-show="show1">
                <TablePerWeldments :fileListHK='fileListHK' @uploadTableHKSH='uploadTableHKSH'
                  @createPreWeldedPartFiles='createPreWeldedPartFiles' :fileListHKTow='fileListYHjTow'
                  @uploadTableHKSHTow='uploadTableHKSHTow' @downloadTemplate='downloadTemplate'></TablePerWeldments>
              </div>
            </transition>
          </el-tab-pane>



          <el-tab-pane v-if="!valueSwich && equipInfo.equip_class.includes('容器') && equipInfo.installation_mode == '鞍座'"
            label="静设备结构安装条件表" name="静设备结构安装条件表">
            <transition>
              <div v-show="show4">
                <el-tabs type="card" ref="buttonRef" tab-position="left" class="demo-tabs_ds" v-model="activeNewName">
                  <el-tab-pane label="设备工艺参数" name="设备工艺参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        设备工艺参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">
                            <el-form-item label="管/壳程介质特性" prop="fluid_property">
                              <el-input disabled size="small" v-model="vesselData.fluid_property" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="管/壳程介质密度(kg/m3)" prop="fluid_density">
                              <el-input disabled size="small" v-model="vesselData.fluid_density" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="设计温度(℃)" prop="fluid_density">
                              <el-input disabled size="small" v-model="vesselData.design_temperature"
                                placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="公称直径DN" prop="fluid_density">
                              <el-input disabled size="small" v-model="vesselData.nominal_diam" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="设备长度L(mm)" prop="tube_length">
                              <el-input disabled size="small" v-model="vesselData.tube_length" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="保温厚度(mm)" prop="insulation_thickness">
                              <el-input disabled size="small" v-model="vesselData.insulation_thickness"
                                placeholder="请输入" />
                            </el-form-item>



                            <el-form-item label="全容积(m3)" prop="full_volume">
                              <el-input disabled size="small" v-model="vesselData.full_volume" placeholder="请输入" />
                            </el-form-item>


                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>
                  <el-tab-pane label="设备质量参数" name="设备质量参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        设备质量参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">
                            <el-form-item label="空质量" prop="equip_dry_weight">
                              <el-input disabled size="small" v-model="vesselData.equip_dry_weight" placeholder="请输入" />
                            </el-form-item>
                            <el-form-item label="净质量" prop="net_weight">
                              <el-input size="small" v-model="vesselData.net_weight" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="吊装质量" prop="lifting_weight">
                              <el-input size="small" v-model="vesselData.lifting_weight" placeholder="请输入" />
                            </el-form-item>



                            <el-form-item label="操作质量" prop="operating_weight">
                              <el-input size="small" v-model="vesselData.operating_weight" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="最大质量" prop="maximum_weight">
                              <el-input size="small" v-model="vesselData.maximum_weight" placeholder="请输入" />
                            </el-form-item>
                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>

                  <el-tab-pane label="支座参数" name="支座参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        支座参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">
                            <el-form-item class="contentMessage" label="支座型号" prop="support_type">
                              <el-select size="small" v-model="vesselData.support_type" placeholder="请输入">
                                <el-option v-for="(item, index) in [
                                  {
                                    label: 'A',
                                    value: '120,A',
                                  },
                                  {
                                    label: 'B-1',
                                    value: '120,B-1',
                                  },
                                  {
                                    label: 'B-2',
                                    value: '150,B-2',
                                  },
                                ]" :key="index" :label="item.label" :value="item.value"></el-option>
                              </el-select>
                            </el-form-item>

                            <el-form-item label="支座数量" prop="support_count">
                              <el-input size="small" v-model="vesselData.support_count" placeholder="请输入" />
                            </el-form-item>
                            <el-form-item label="支撑高度(mm)" prop="support_height">
                              <el-input size="small" v-model="vesselData.support_height" placeholder="请输入" />
                            </el-form-item>
                            <el-form-item label="支座间距(mm)" prop="support_spacing">
                              <el-input size="small" v-model="vesselData.support_spacing" placeholder="请输入" />
                            </el-form-item>
                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>

                  <el-tab-pane label="单支座螺栓参数" name="单支座螺栓参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        单支座螺栓参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">


                            <el-form-item label="材质" prop="singlesupportbolt_material">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_material"
                                placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="数量" prop="singlesupportbolt_quantity">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_quantity"
                                placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="间距l2(mm)" prop="singlesupportbolt_spacing_l2">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_spacing_l2
                                " placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="间距l4(mm)" prop="singlesupportbolt_spacing_l4">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_spacing_l4
                                " placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="规格" prop="singlesupportbolt_specification">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_specification
                                " placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="外伸长度(mm)" prop="singlesupportbolt_cantilever_length">
                              <el-input size="small" v-model="vesselData.singlesupportbolt_cantilever_length
                                " placeholder="请输入" />
                            </el-form-item>



                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>


                  <el-tab-pane label="底板参数" name="底板参数">
                    <template #label>
                      <p style="
                          overflow: hidden;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          width: 70px;
                          font-size: 11px;
                        ">
                        底板参数
                      </p>
                    </template>
                    <div class="content_tabs">
                      <div class="inside_from_s">
                        <el-form label-position="top" :inline="true" ref="designformRef" size="small"
                          label-width="120px">
                          <div class="flex_style">


                            <el-form-item label="l1(mm)" prop="base_plate_l1">
                              <el-input size="small" v-model="vesselData.base_plate_l1" placeholder="请输入" />
                            </el-form-item>

                            <el-form-item label="b1(mm)" prop="base_plate_b1">
                              <el-input size="small" v-model="vesselData.base_plate_b1" placeholder="请输入" />
                            </el-form-item>
                          </div>
                        </el-form>
                      </div>
                    </div>
                  </el-tab-pane>
                </el-tabs>
              </div>
            </transition>
          </el-tab-pane>
        </el-tabs>

        <el-dialog draggable v-model="dialogFormVisibleEditTable" :destroy-on-close="true"
          :title="`${equipInfo.equip_class}-${editedRowData.shape_type}`" width="28%"
          :before-close="() => handleClose(ruleFormRefNew)">
          <el-form ref="ruleFormRefNew" :model="editedRowData" size="small" :label-width="fnWidth"
            class="demo-ruleForm-new" status-icon>
            <el-form-item label="基本体：">
              <el-select disabled size="small" v-model="editedRowData.shape_type" @change="shapeTypeChange()"
                style="width: 100%" clearable filterable>
                <template v-if="equipInfo.equip_type === '卧式设备'">
                  <el-option v-for="(item, index) in HEquipTypes" :key="index" :value="shapeInfos[item.name].name" />
                </template>
                <template v-else-if="equipInfo.equip_type === '立式设备'">
                  <el-option v-for="(item, index) in VEquipTypes" :key="index" :value="shapeInfos[item.name].name" />
                </template>
              </el-select>
            </el-form-item>

            <el-form-item v-for="item in dialogParaLabels" :key="item.label" :label="`${item.label}：`">
              <el-select size="small" v-if="item.hasOwnProperty('elSelect')" v-model="editedRowData[item.prop]"
                style="width: 100%" clearable filterable>
                <el-option v-for="item in liftingLegTypes" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
              <el-input size="small" v-else v-model="editedRowData[item.prop]" />
            </el-form-item>

            
            <el-form-item v-if='editedRowData.shape_type === "鞍座"' label-width="180px">
							
							<el-checkbox-group  v-model="is_saddle_fixed_list">
    <el-checkbox :disabled='is_saddle_fixed_list.includes("右端固定")'  label="左端固定" value="左端固定" />
    <el-checkbox :disabled='is_saddle_fixed_list.includes("左端固定")'  label="右端固定" value="右端固定" />
    
  </el-checkbox-group>
						</el-form-item>

            <el-form-item label="保温/涂漆和防火：" label-width="180px">

              <el-checkbox-group v-model="checkList">
                <el-checkbox label="保温/涂漆" value="保温/涂漆" />
                <el-checkbox label="防火" value="is_fireproof" />

              </el-checkbox-group>
            </el-form-item>

            <el-form-item>
              <div class="button_footer">
                <el-button @click="dialogFormVisibleEditTable = false">取消</el-button>
                &nbsp;&nbsp;&nbsp;
                <el-button type="primary" @click="submitFormNew(ruleFormRefNew)">确认</el-button>
              </div>
            </el-form-item>
          </el-form>
        </el-dialog>

        <el-dialog :title="`${equipInfo.equip_class}-管口`" v-model="dialogFormVisibleEditTablenozzles"
          :close-on-click-modal="false" width="22%">
          <el-form label-width="100px" :model="editedRowDatanozzles" label-position="right" size="small">
            <!-- 管口名称 -->
            <el-form-item label="管口名称：">
              <el-input size="small" v-model="editedRowDatanozzles.nozzle_name"></el-input>
            </el-form-item>

            <el-form-item label="管口尺寸：">
              <el-select style="width: 100%" size="small" v-model="editedRowDatanozzles.nozzle_npd" filterable>
                <el-option v-for="(npd, index) in nozzleInfo.nozzleNpd" :key="index" :label="npd.label"
                  :value="npd.value"></el-option>
              </el-select>
            </el-form-item>

            <!-- 法兰磅级 -->
            <el-form-item label="法兰磅级：">
              <el-select style="width: 100%" size="small" v-model="editedRowDatanozzles.nozzle_rating" filterable>
                <el-option v-for="(press, index) in nozzleInfo.nozzleRating" :key="index" :label="press.label"
                  :value="press.value"></el-option>
              </el-select>
            </el-form-item>

            <!-- 法兰标准 -->
            <el-form-item label="法兰标准：">
              <el-select style="width: 100%" size="small" v-model="editedRowDatanozzles.nozzle_standard" filterable>
                <el-option v-for="(standard, index) in nozzleInfo.nozzleStandard" :key="index" :label="standard.label"
                  :value="standard.value"></el-option>
              </el-select>
            </el-form-item>

            <!-- 法兰密封面 -->
            <el-form-item label="法兰密封面：">
              <el-select style="width: 100%" size="small" v-model="editedRowDatanozzles.nozzle_preparation" filterable>
                <el-option v-for="(preparation, index) in nozzleInfo.nozzlePreparation" :key="index"
                  :label="preparation.label" :value="preparation.value"></el-option>
              </el-select>
            </el-form-item>

            <!-- 开孔位置 -->
            <el-form-item label="开孔位置：">
              <el-select style="width: 100%" v-if="equipInfo.installation_mode == '鞍座'"
                v-model="editedRowDatanozzles.nozzle_location" size="small"
                @visible-change="nozzleLocationChange($event)">
                <el-option v-for="(location, index) in nozzleInfo.nozzleLocation1" :key="index"
                  :value="location"></el-option>
              </el-select>

              <el-select style='width:100%' label-width="150px" v-if="equipInfo.installation_mode !== '鞍座'"
                v-model="editedRowDatanozzles.nozzle_location" size="small"
                @visible-change="nozzleLocationChange($event)">
                <el-option v-for="(location, index) in nozzleInfo.nozzleLocation" :key="index"
                  :value="location"></el-option>
              </el-select>
            </el-form-item>

            <el-form-item>
              <div class="button_footer">
                <el-button @click="dialogFormVisibleEditTablenozzles = false">取消</el-button>
                &nbsp;&nbsp;&nbsp;
                <el-button type="primary" @click="editNozzleApply(ruleFormRefNew)">确认</el-button>
              </div>
            </el-form-item>
          </el-form>

          <!-- 开孔位置嵌套对话框 -->
          <el-dialog width="30%" :title="`${editedRowDatanozzles.nozzle_location}处的管口`" v-model="innerVisible"
            :close-on-click-modal="false" append-to-body>
            <el-form label-width="170px" size="small" :model="editedRowDatanozzles">
              <!-- 左/右封头 -->
              <template v-if="
                editedRowDatanozzles.nozzle_location === '左封头' ||
                editedRowDatanozzles.nozzle_location === '右封头' ||
                editedRowDatanozzles.nozzle_location === '上封头' ||
                editedRowDatanozzles.nozzle_location === '下封头'
              ">
                <el-form-item v-for="(item, index) in nozzleInfo.nozzleLocationType.EHA
                  .labels" :key="index" :label='`${item.label}：`'>
                  <el-input size="small" v-model="editedRowDatanozzles[item.prop]"></el-input>
                </el-form-item>
              </template>

              <!-- 筒体 -->
              <template v-else-if="editedRowDatanozzles.nozzle_location === '筒体'">
                <el-form-item v-for="(item, index) in nozzleInfo.nozzleLocationType.Cylinder
                  .labels" :key="index" :label='`${item.label}：`'>
                  <el-input size="small" v-model="editedRowDatanozzles[item.prop]"></el-input>
                </el-form-item>
              </template>

              <!-- 锥壳 -->
              <template v-else-if="editedRowDatanozzles.nozzle_location === '锥壳'">
                <el-form-item v-for="(item, index) in nozzleInfo.nozzleLocationType.Shell
                  .labels" :key="index" :label='`${item.label}：`'>
                  <el-input size="small" v-model="editedRowDatanozzles[item.prop]"></el-input>
                </el-form-item>
              </template>

              <el-form-item>
                <div class="button_footer">
                  <el-button @click="cancelGo()">取消</el-button>
                  &nbsp;&nbsp;&nbsp;
                  <el-button type="primary" @click="
                    editNozzleInnerApply(editedRowDatanozzles.nozzle_location)
                    ">确认</el-button>
                </div>
              </el-form-item>
            </el-form>
          </el-dialog>
        </el-dialog>


        <el-dialog v-model="dialogVisibleviewExcel" title="管口预览表" width="50%">
          <el-table :data="tableViewData" class="roledata" border size='small' height="500"
            :span-method="tableSpanMethod">

            <el-table-column prop="nozzleName" label="管口名称">

            </el-table-column>
            <el-table-column prop="stdNo" label="图号或标准号"> </el-table-column>

            <el-table-column prop="desc" label="名称"> </el-table-column>
            <el-table-column prop="count" label="数量"></el-table-column>
            <el-table-column prop="material" label="材料"></el-table-column>
            <el-table-column label="质量（KG）">
              <el-table-column prop="single_weight" label="单"></el-table-column>
              <el-table-column prop="muilt_weight" label="总"></el-table-column>
            </el-table-column>
            <el-table-column prop="note" label="备注"></el-table-column>
          </el-table>
        </el-dialog>
      </div>
    </el-scrollbar>
  </transition>
</template>

<script setup>
  import Sortable from "sortablejs";
  import {
    Download,
    Upload,
    Calendar,
    Check,
    Delete,
    Edit,
    Message,
    Search,
    Star,
    DocumentCopy,
    Top,
    Bottom,
    Guide,
    Coordinate,
  } from "@element-plus/icons-vue";

  import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
  import {
    defineAsyncComponent,
    ref,
    reactive,
    onMounted,
    nextTick,
    computed,
    watch,
    getCurrentInstance
  } from "vue";
  import {
    Exportbembyid,
    calculateshape,
    ImportExcelForModelInput,
    ExportExcelForModelInput,
    ReceiveNozzleLocation,
    CalculateEquipPaintedSurfaceArea,
    DeleteNozzle,
    AddNozzle,
    ModifyNozzle,
    GetEquipmentNozzle,
    DeleteAllShape,
    AddShape,
    UpdateLastModifyTime,
    ModifyShape,
    getequipmentshape,
    SaveNozzleDesignDatas,
    saveBEMDesigndatas,
    SaveVesselsDesignDatas,
    SaveModelParam,
    DelBEMNozzleDesignDatas,
    GetNozzleReinforcingRingMeta,
    GetNozzleInternalComponentsMeta,
    GetNozzleConnectTubeMaterialMeta,
    GetBEMNozzleDesignDatas,
    getBEMdesigndatas,
    GetVesselsDesignDatas,
    getArrangeAnglemetadatas,
    getbooloptiondatas,
    getGasketTypeMetadatas,
    getStandardMetadatas,
    getRatingMetadatas,
    DeleteAllShapeCal,
    GetVesselsDesignInput,
    GetBEMShapeDatas,
    DeleteAllNozzle,
    DeleteAllNozzleCal,
    GetNozzleModelDatas,
    calculatenozzle,
    CalculateNozzleV2,
    AddBEMNozzle,
    CalNozzleMaterialListV2,
    CreateNozzleMaterialListV2,
    ImportPipeSuppPreWeldedPartDatas,


    ImportPlantformPreWeldedPartDatas,
    DownloadPlantformPreWeldedPartTempFile,
    CreatePipeSuppPreWeldedPartTables,
    GetVesselSupportDatasForSaddle,
    SaveVesselSupportDatasForSaddle,
    GetSaddleDatas
  } from "../../../api/equipment/index";
  import { NozzleInfo as NozzleInfoOptions } from "../../../utils/nozzleTypeInfo";
  import {
    HEquipShapeTypes,
    VEquipShapeTypes,
    ShapeParams,
    NozzleParamOptions,
  } from "../../../assets/js/equiipentBaseDatas";
  import { liftingLegTypes as liftingLegTypesD } from "../../../assets/js/LiftingLug.js";
  import { useEquipmentStore } from "../../../stores/equipment";

  import TableShapList from './table_shapList.vue'
  import TableNozzleList from './table_nozzleList.vue'
  import TablePerWeldments from './table_preWeldments.vue'
  let store = useEquipmentStore();

  let myThis = getCurrentInstance()
  let nozzleTable = ref(null)
  watch(() => store.nozzleName, () => {

    if (store.nozzleName) {
      document.querySelector('#tab-管口').click()

      setTimeout(() => {

        tableScrollToRow(myThis.refs.table_s_exp_2, store.nozzleName);

      }, 100)

    }
  })

  let tableRowClassName = ({ row }) => {
    if (row.nozzle_name == store.nozzleName) {
      return 'success-row_row'
    }
  }

  let tableScrollToRow = (tableElement, name, isprecise = false) => {
    const theTableRows = tableElement.$el.querySelectorAll('.el-table__body tbody .el-table__row')
    let scrollTop = 0
    for (let i = 0; i < theTableRows.length; i++) {

      if (theTableRows[i].innerText.includes(name)) {
        break
      }

      scrollTop += theTableRows[i].offsetHeight

    }

    tableElement.scrollTo(0, scrollTop)
  }


  let activeHeight1 = ref(0)
  onMounted(() => {

    setTimeout(() => {
      activeHeight1.value = `${document.querySelector(".bottom_from_inside").clientHeight - 130}px`

      window.addEventListener('resize', () => {
        activeHeight1.value = `${document.querySelector(".bottom_from_inside").clientHeight - 130}px`


      })

    }, 1000)
  })

  watch(
    () => store.newPrimitivesDataStore,
    async () => {
      if (Object.keys(store.newPrimitivesDataStore).length > 0) {
        await AddShape({
          ...store.newPrimitivesDataStore,
          equip_oid: equip_oid.value,
          user: JSON.parse(localStorage.getItem("userMessage")).user_name
        });
        UpdateLastModifyTimeData({ equip_oid: equip_oid.value });
        getequipmentshapeData();
        store.newPrimitivesDataStore = {};
        store.newPrimitivesDataStoreMessage = true;
        ElMessage({
          message: "添加成功",
          type: "success",
        });
      }
    },
    { deep: true }
  );



  let fileListHK = ref([])
  let uploadTableHK = (file) => {

    //  fileListHK.value.push(file)

  }
  let uploadTableHKSH = async (arr) => {
    fileListHK.value = arr
    arr.forEach(async (v, i) => {
      let fromData = new FormData();
      fromData.append("file", v.raw);
      try {
        await ImportPipeSuppPreWeldedPartDatas(fromData, equip_oid.value);
      } catch (error) {
        ElMessage.error("文件上传失败");
      }

      if (fileListHK.value.length - 1 == i) {
        ElMessage.success("上传成功");
      }
    });
  };

  let createPreWeldedPartFiles = async () => {
    let res = await CreatePipeSuppPreWeldedPartTables({ equip_oid: equip_oid.value })
    if (res.data === "当前设备尚未导入管道支架贴板数据！") {
      ElMessage.warning(res.data);
    } else {
      window.location.replace(
        `api/EquipPreWeldedParts/CreatePipeSuppPreWeldedPartTables?equip_oid=${equip_oid.value}`
      );
    }
  }

  let uploadTable = async (file) => {
    ElMessageBox.confirm(
      `${equipInfo.value.equip_no}设备的数据将被覆盖，请确认？`,
      "上传文件",
      {
        type: "warning",
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        buttonSize: "small",
      }
    ).then(async () => {
      let fromData = new FormData();
      fromData.append("file", file.file);
      let respone = await ImportExcelForModelInput(fromData, equip_oid.value);
      if (!respone.SheetsCheckResualt) {
        ElMessage({
          message: "导入文件中sheet名不正确！",
          type: "error",
        });
      } else if (!respone.NozzleDataImportResualt) {
        ElMessage({
          message: "NozzleList中数据不正确！",
          type: "error",
        });
      } else if (!respone.ShapeDataImportResualt) {
        ElMessage({
          message: "ShapeList中数据不正确！",
          type: "error",
        });
      } else {
        ElMessage({
          message: "导入成功",
          type: "success",
        });
        getequipmentshapeData();
        GetEquipmentNozzleData();
      }
    });
  };

  watch(
    () => store.newNozzleDataStore,
    async () => {
      if (Object.keys(store.newNozzleDataStore).length > 0) {
        await AddNozzle({
          ...store.newNozzleDataStore,
          equip_oid: equip_oid.value,
        });
        GetEquipmentNozzleData();
        UpdateLastModifyTimeData({ equip_oid: equip_oid.value });
        ElMessage({
          message: "添加成功",
          type: "success",
        });
        store.newNozzleDataStoreMessage = true;
        store.newNozzleDataStore = {};
      }
    },
    { deep: true }
  );

  const activeName = ref("基本体");

  let deleteRowNozzle = async (index, rows) => {
    await DeleteNozzle({ nozzle_oid: rows[index].nozzle_oid });
    rows.splice(index, 1);
    UpdateLastModifyTimeData({ equip_oid: equip_oid.value });
    ElMessage({
      message: "删除成功",
      type: "success",
    });
  };

  let copyRownozzles = async (row, rows) => {
    let newNozzleRow = { ...row };
    newNozzleRow.nozzle_name = `Copy-of-${row.nozzle_name}`;
    await AddNozzle({
      ...newNozzleRow,
      equip_oid: equip_oid.value,
    });
    GetEquipmentNozzleData();
    UpdateLastModifyTimeData({ equip_oid: equip_oid.value });
    ElMessage({
      message: "复制成功",
      type: "success",
    });
  };

  let editNozzleApply = async () => {
    await ModifyNozzle({
      ...editedRowDatanozzles.value,
    });
    GetEquipmentNozzleData();
    UpdateLastModifyTimeData({ equip_oid: equip_oid.value });
    ElMessage({
      message: "修改成功",
      type: "success",
    });
    dialogFormVisibleEditTablenozzles.value = false;
  };

  let editNozzleInnerApply = (nozzleLocation) => {
    let types = "";
    if (nozzleLocation.includes("封头")) {
      types = "EHA";
    } else if (nozzleLocation === "筒体") {
      types = "Cylinder";
    } else if (nozzleLocation === "锥壳") {
      types = "Shell";
    }

    const nozzleRequireParams =
      nozzleInfo.value.nozzleLocationType[types].nozzleRequireParams;
    for (const key in editedRowDatanozzles.value) {
      if (
        key.startsWith("parameter_") &&
        !nozzleRequireParams.hasOwnProperty(key)
      ) {
        editedRowDatanozzles.value[key] = "-";
      }
    }
    innerVisible.value = false;
  };

  let designformRef = ref("");

  let computeder = async () => {
    let resShape = await calculateshape({ equip_oid: equip_oid.value });

    if (Array.isArray(resShape) && resShape.length > 0) {
      ElMessage({
        message: "基本体计算成功",
        type: "success",
      });
    } else {
      await DeleteAllShapeCal({
        equip_oid: equip_oid.value,
      });
      ElMessage({
        message: "基本体计算失败，请检测参数",
        type: "error",
      });
    }
    let resNozzle = await CalculateNozzleV2({
      equip_oid: equip_oid.value,
    });

    if (Array.isArray(resNozzle) && resNozzle.length > 0) {

      ElMessage({
        message: "管口计算成功",
        type: "success",
      });
    } else {
      await DeleteAllNozzleCal({
        equip_oid: equip_oid.value,
      });
      ElMessage({
        message: "管口计算失败，请检查参数",
        type: "error",
      });
    }

    store.computedCount += store.shapesDataCalStore = resShape;
  };

  let innerVisible = ref(false);
  let nozzleLocationChange = (e) => {
    if (!e) {
      setTimeout(() => {
        innerVisible.value = true;
      }, 500)
    }


  };

  let deleteRow = async (index, rows) => {
    rows.splice(index, 1);
    for (let idx = 1; idx <= rows.length; idx++) {
      rows[idx - 1].shape_index = idx;
    }

    await DeleteAllShape({ equip_oid: equip_oid.value });
    ElMessage({
      message: "删除成功",
      type: "success",
    });

    for (let row of rows) {
      await AddShape({ ...row, equip_oid: equip_oid.value, user: JSON.parse(localStorage.getItem("userMessage")).user_name });
    }
    UpdateLastModifyTimeData({ equip_oid: equip_oid.value });
  };

  let moveDownRow = (index, rows) => {
    if (index !== rows.length - 1) {
      rows[index].shape_index++;
      rows[index + 1].shape_index--;
      rows[index] = rows.splice(index + 1, 1, rows[index])[0];
      for (let row of rows) {
        ModifyShapeData({ ...row });
      }

      ElMessage({
        message: "上移成功",
        type: "success",
      });
    } else {
      ElMessage({
        message: "当前行为最后一行，无法执行下移操作！",
        type: "error",
      });
    }
  };

  let moveUpRow = async (index, rows) => {
    if (index !== 0) {
      rows[index].shape_index--;
      rows[index - 1].shape_index++;
      rows[index] = rows.splice(index - 1, 1, rows[index])[0];
      for (let row of rows) {
        console.log(rows, row)
        ModifyShapeData({ ...row });
      }
      ElMessage({
        message: "上移成功",
        type: "success",
      });
    } else {
      ElMessage({
        message: "当前行为第一行，无法执行上移操作！",
        type: "error",
      });
    }
  };

  let copyRow = async (row) => {
    let data = {
      ...row,
      shape_index: primitivesData.value.length + 1,
      user: JSON.parse(localStorage.getItem("userMessage")).user_name
    };
    await AddShape(data);
    getequipmentshapeData();
    UpdateLastModifyTimeData({ equip_oid: equip_oid.value });
    ElMessage({
      message: "复制成功",
      type: "success",
    });
  };
  let is_saddle_fixed_list = ref([])
  let submitFormNew = () => {
    for (let key in editedRowData.value) {
      if (
        key.startsWith("parameter_") &&
        !shapeRequireParams.value.hasOwnProperty(key)
      ) {
        editedRowData.value[key] = "-";
      }
    }
    if (checkList.value.includes('保温/涂漆')) {
      editedRowData.value.is_painted = "true"
    } else {
      editedRowData.value.is_painted = "false"
    }

    if (checkList.value.includes('防火')) {
      editedRowData.value.is_fireproof = "true"
    } else {
      editedRowData.value.is_fireproof = "false"
    }


    if(is_saddle_fixed_list.value.includes('左端固定')){
            editedRowData.value.is_saddle_fixed = 1
	  }else if(is_saddle_fixed_list.value.includes('右端固定')){
		editedRowData.value.is_saddle_fixed = 2
	  }else{
		editedRowData.value.is_saddle_fixed = 0
	  }
    ModifyShapeData({ ...editedRowData.value });

    ElMessage({
      message: "修改成功",
      type: "success",
    });
    dialogFormVisibleEditTable.value = false;
  };

  let ModifyShapeData = async (data) => {
    await ModifyShape(data);
    getequipmentshapeData();
    UpdateLastModifyTimeData({ equip_oid: equip_oid.value });
  };

  let UpdateLastModifyTimeData = async (data) => {
    await UpdateLastModifyTime(data);
  };

  let primitivesData = ref([]);

  let getequipmentshapeData = async () => {
    let res = await getequipmentshape({ equip_oid: equip_oid.value });

    if (res.length > 0) {
      store.primitivesDataStore = res;
      primitivesData.value = res;
    } else {
      primitivesData.value = [];
      store.primitivesDataStore = []
    }
  };

  let liftingLegTypes = ref([]);
  liftingLegTypes.value = liftingLegTypesD;
  let shapeTypeChange = () => {
    for (let key in ShapeParams) {
      if (ShapeParams[key].name === editedRowData.value.shape_type) {
        dialogParaLabels.value = ShapeParams[key].labels;
        shapeRequireParams.value = ShapeParams[key].shapeRequireParams;
        break;
      }
    }
    fnWidths();
  };
  let shapeRequireParams = ref({});

  let fnWidth = ref("100px");
  let fnWidths = () => {
    let text = [];
    dialogParaLabels.value.forEach((v) => {
      text.push(v.label.length);
    });

    let sortArr = [...new Set(text)].reverse();

    if (sortArr[0] >= 1 && sortArr[0] < 13) {
      fnWidth.value = "180px";
    } else if (sortArr[0] >= 13 && sortArr[0] < 17) {
      fnWidth.value = "180px";
    } else if (sortArr[0] > 17) {
      fnWidth.value = "180px";
    }
  };

  let calculateModel = async () => {
    ElMessageBox.confirm("此操作将覆盖设备原有基本体数据，是否继续？", "提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    }).then(async () => {
      ElNotification({
        type: 'Error',
        title: '正在计算中....',
        message: '正在计算模型，请勿关闭当前页面......',
        duration: 5000,
      })
      store.computedCaCount = true



      const shapeDatas = await GetBEMShapeDatas({
        equip_oid: equip_oid.value,
      });
      console.log(1);
      let resData = shapeDatas;

      if (resData.length) {

        await DeleteAllShape({
          equip_oid: equip_oid.value,
        });
        console.log(1)
        await DeleteAllShapeCal({
          equip_oid: equip_oid.value,
        });
        console.log(2)

        for (let index = 0; index < resData.length; index++) {
          let shapeData = resData[index];
          let shape = {
            equip_oid: equip_oid.value,
            shape_index: index + 1,
            ...shapeData,
            user: JSON.parse(localStorage.getItem("userMessage")).user_name
          };

          await AddShape({
            ...shape,
          });
          console.log(4);
        }
      } else {
        ElMessage.error('请检查基本体参数')
        store.computedCaCount = false;
        return
      }




      let res = await calculateshape({
        equip_oid: equip_oid.value,
      });
      console.log(5)
      if (res) {
        ElMessage({
          message: "设备基本体计算完成！",
          title: "成功",
          type: "success",
        });
      } else {
        ElMessage({
          message: "设备基本计算失败，请检查录入数据是否正确！",
          title: "错误",
          type: "error",
        });
        store.computedCaCount = false
        return;
      }


      let nozzleDatas = await GetNozzleModelDatas({
        equip_oid: equip_oid.value,
      });
      console.log(8);
      let resData2 = nozzleDatas;
      if (resData2.length) {

        await DeleteAllNozzle({
          equip_oid: equip_oid.value,
        });
        console.log(6)
        await DeleteAllNozzleCal({
          equip_oid: equip_oid.value,
        });
        console.log(7)

        for (let index = 0; index < resData2.length; index++) {
          let nozzleData = resData2[index];
          await AddBEMNozzle({
            ...nozzleData,
          });
          console.log(9);
        }
      } else {
        ElMessage.error('请检查管口参数')
        store.computedCaCount = false;
        return
      }





      let res2 = await CalculateNozzleV2({
        equip_oid: equip_oid.value,
      });
      console.log(10)
      if (res2 !== 'False') {
        ElMessage({
          message: "设备管口计算完成！",
          title: "成功",
          type: "success",
        });
      } else {
        ElMessage({
          message: "设备管口计算失败，请检查录入数据是否正确！",
          title: "错误",
          type: "error",
        });
        store.computedCaCount = false
        return;
      }
      ElNotification({
        type: 'success',
        title: '计算完成',
        message: '模型计算完成',
        duration: 2000,
      })
      setTimeout(() => {
        console.log(11)
        store.computedCount++
      }, 200)
      store.computedCaCount = false
    });
  };



  let fileListYHjTow = ref([]);



  let uploadTableHKSHTow = async (arr) => {

    fileListYHjTow.value = arr
    arr.forEach(async (v, i) => {
      let fromData = new FormData();
      fromData.append("file", v.raw);
      try {
        let res = await ImportPlantformPreWeldedPartDatas(
          fromData,
          equip_oid.value,
          JSON.parse(localStorage.getItem("userMessage")).user_name
        );
        if (res.data !== "True") {
          ElMessage.error(res.data);
        } else {
          if (fileListYHjTow.value.length - 1 == i) {
            ElMessage.success("上传成功");
          }
        }
      } catch (error) {
        ElMessage.error("文件上传失败");
      }

    });

  };


  let downloadTemplate = async () => {
    let res = await DownloadPlantformPreWeldedPartTempFile()
    let filename = res.headers; //下载后文件名
    let filename2 = ""; //下载后文件名
    filename = filename["content-disposition"];
    filename = window.decodeURI(filename);
    filename2 = filename.split(";")[1].split("filename*=UTF-8''")[1];
    filename = filename.split(";")[1].split("filename=")[1];
    const link = document.createElement("a"); // 创建a标签
    const blo = new Blob([res.data], { type: res.data.type }); // 设置下载格式
    link.style.display = "none";
    const url = window.URL.createObjectURL(blo);
    console.log(url)
    link.href = url;
    if (filename == undefined) {
      filename = filename2;
    }
    link.download = filename;

    // link.setAttribute('download', "fileName")3
    document.body.appendChild(link);
    link.click(); // 触发下载
    window.URL.revokeObjectURL(url); // 释放掉blob对象
    document.body.removeChild(link);
    ElMessage({
      message: "下载成功",
      type: "success",
    })
  }


  let exportdatas = async () => {
    ElNotification({
      position: "top-right",
      title: "正在导出",
      message: `正在导出表格请稍后....`,
      type: "warning",
      duration: 6000,
    });
    let res = await Exportbembyid({ equip_oid: equip_oid.value });
    try {
      let filename = res.headers; //下载后文件名
      let filename2 = ""; //下载后文件名
      filename = filename["content-disposition"];
      filename = window.decodeURI(filename);
      filename2 = filename.split(";")[1].split("filename*=UTF-8''")[1];
      filename = filename.split(";")[1].split("filename=")[1];
      const link = document.createElement("a"); // 创建a标签
      const blo = new Blob([res.data], { type: res.data.type }); // 设置下载格式
      link.style.display = "none";
      const url = window.URL.createObjectURL(blo);
      link.href = url;
      if (filename == undefined) {
        filename = filename2;
      }
      link.download = filename;

      document.body.appendChild(link);
      link.click(); // 触发下载
      window.URL.revokeObjectURL(url); // 释放掉blob对象
      document.body.removeChild(link);
    } catch (err) {
      ElMessage({
        message: "请检查参数是否正确",
        type: "error",
      })
    }

  };

  let dialogParaLabels = ref({});
  let HEquipTypes = ref([]);
  let VEquipTypes = ref([]);
  let shapeInfos = ref({});
  HEquipTypes.value = HEquipShapeTypes;
  VEquipTypes.value = VEquipShapeTypes;
  shapeInfos.value = ShapeParams;

  let handleClose = (refsd) => {
    dialogFormVisibleEditTable.value = false;
    refsd.resetFields();
  };
  let ruleFormRefNew = ref(null);
  let dialogFormVisibleEditTable = ref(false);
  let editedRowData = ref({});
  let checkList = ref([]);
  let editRow = (rowIdx, row) => {
    editedRowData.value = { ...row };
    checkList.value = []

    is_saddle_fixed_list.value = []
    if (editedRowData.value.is_painted === "true") {
      checkList.value.push('保温/涂漆')
    }
    if (editedRowData.value.is_fireproof === "true") {
      checkList.value.push('防火')
    }


    if (editedRowData.value.is_saddle_fixed === 1) {
            is_saddle_fixed_list.value.push('左端固定')
        }
        if (editedRowData.value.is_saddle_fixed === 2) {
            is_saddle_fixed_list.value.push('右端固定')
        }
        if (editedRowData.value.is_saddle_fixed === 0) {
            is_saddle_fixed_list.value = []
        }
    shapeTypeChange();
    dialogFormVisibleEditTable.value = true;
  };

  let editedRowDatanozzles = ref({});
  let dialogFormVisibleEditTablenozzles = ref(false);
  let editRownozzles = (rowIdx, row) => {
    editedRowDatanozzles.value = { ...row };
    copyData.value = { ...row }
    dialogFormVisibleEditTablenozzles.value = true;
  };

  let nozzleInfo = ref({});
  nozzleInfo.value = NozzleInfoOptions;
  let designform = ref({
    nominal_dia: "",
    tube_wall_thickness: "",
    tube_head_thickness: "",
    shell_wall_thickness: "",
    thickenedsection_length: "",
    thickenedsection_thickness: "",
    flange_standard_id: "",
    flange_rating_id: "",
    front_tangent_dis: "",
    back_tangent_dis: "",
    gasket_type_id: "",
    gasketboss_height: "",
    tubeplate_thickness: "",
    tubeplate_isflange: "",
    is_standardflange: "",
    expansionjoint_requirement: "",
    tube_length: "",
    tube_diameter: "",
    tube_thickness: "",
    tube_extend_thickness: "",
    tube_arrange_angle: "",
    tube_sidenumber: "",
    shell_impactplate_require: "",
    rod_diameter: "",
    bafflecut_adjust: "",
    bafflecut_dir: "",
    ntiw: "",
    bafflecut_length: "",
    bafflecut_thickness: "",
    bafflecut_toleft_dis: "",
    bafflecut_spacing: "",
    baffle_count: "",
    left_or_top: "",
    saddle_spacing_factor: "",
    saddle_to_lefthead: "",
    saddle_angle: "",
    lifting_type: "",
    frontlifting_pos: "",
    backlifting_pos: "",
    ns_bolt_size: "",
    ns_bolthole_size: "",
    ns_bolt_count: "",
    ns_boltcircle_diameter: "",
    ns_flange_height: "",
    ns_flange_diameter: "",
    ns_flange_d4: "",
    ns_flange_d3: "",
    ns_flange_d2: "",
    ns_flange_thickness: "",
    ns_flange_neckheight: "",
    ns_flange_bside_thickness: "",
    ns_flange_sside_thickness: "",
    ns_flange_guideangle: "",

    expansionjoint_disto_front: "",
    expansionjoint_length: "",
    expansionjoint_r: "",
    corrugatedpipe_mat: "",
    corrugatedpipe_thickness: "",
    corrugate_height: "",
  });


  let getDataFromCenterCom = async () => {

    let res = await CalculateEquipPaintedSurfaceArea({

      equip_oid: equip_oid.value,

    })
    if (res.data.includes('设备表面积为：0')) {
      ElMessage.error(res.data)


    } else {
      ElMessage.success(res.data)
    }

  }

  let getDataFromCenter = async () => {

    let res = await ReceiveNozzleLocation({
      proj_no: equipInfo.value.proj_no,
      equip_oid: equip_oid.value,
      unit_no: equipInfo.value.equip_unit_no,
      equip_no: equipInfo.value.equip_no,
      user: JSON.parse(localStorage.getItem("userMessage")).user_name
    })
    if (res === 'True') {
      ElMessage.success('数据获取成功！')
      computeder()
      listOptions();
      getOptionsGetStandardMetadatas();
      getRatingMetadatasOptions();
      getGasketTypeMetadatasOptions();
      getbooloptiondatasOptions();
      getArrangeAnglemetadatasOptions();
      getBEMdesigndatasList();
      GetBEMNozzleDesignDatasList();
      getequipmentshapeData();
      GetEquipmentNozzleData();
    } else {
      ElMessage.error(res.data)
    }

  }


  let dialogEXportEquipData = async () => {
    await ExportExcelForModelInput({
      equip_oid: equip_oid.value,
    });
    ElNotification({
      position: "top-right",
      title: "正在导出",
      message: `正在导出表格请稍后....`,
      type: "warning",
      duration: 2000,
    });
    window.location.replace(
      `http://10.6.100.80:10002/Exporter/ExportExcelForModelInput?equip_oid=${equip_oid.value}`
    );
  };




  let support_typeOptions = ref([
    {
      value: '刚性环',
      label: '刚性环',

    },
    {
      value: '支腿',
      label: '支腿',

    },
    {
      value: '耳座',
      label: '耳座',

    },
    {
      value: '支承式',
      label: '支承式',

    },

  ])

  let pedestal_modelOptions = ref([])
  watch(() => designform.value.support_type, () => {
    // designform.value.pedestal_model = ''
    pedestal_modelOptions.value = []
    if (designform.value.support_type == '刚性环') {
      for (let i = 0; i < 38; i++) {
        pedestal_modelOptions.value.push({ value: `A${i + 1}`, label: `A${i + 1}` })
        pedestal_modelOptions.value.push({ value: `B${i + 1}`, label: `B${i + 1}` })
      }
    } else if (designform.value.support_type == '支腿') {
      for (let i = 0; i < 6; i++) {
        pedestal_modelOptions.value.push({ value: `A${i + 1}`, label: `A${i + 1}` })
        pedestal_modelOptions.value.push({ value: `B${i + 1}`, label: `B${i + 1}` })
        pedestal_modelOptions.value.push({ value: `C${i + 1}`, label: `C${i + 1}` })
      }
    } else if (designform.value.support_type == '耳座') {
      for (let i = 0; i < 8; i++) {
        pedestal_modelOptions.value.push({ value: `A${i + 1}`, label: `A${i + 1}` })
        pedestal_modelOptions.value.push({ value: `B${i + 1}`, label: `B${i + 1}` })
        pedestal_modelOptions.value.push({ value: `C${i + 1}`, label: `C${i + 1}` })
      }
    } else if (designform.value.support_type == '支承式') {
      for (let i = 0; i < 6; i++) {
        pedestal_modelOptions.value.push({ value: `A${i + 1}`, label: `A${i + 1}` })

      }
      for (let i = 0; i < 8; i++) {
        pedestal_modelOptions.value.push({ value: `B${i + 1}`, label: `B${i + 1}` })

      }
    }
  })


  let lazyLoadingData = ref([])
  let standardoptions = ref([]);
  let ratingoptions = ref([]);
  let gkLoading = ref(false)
  let valueSwichLoading = ref(false)
  let hiddenButtonShow = ref(false)
  const handleClick = async (tab, event) => {

    if (tab.paneName == '管口参数') {
      hiddenButtonShow.value = true
      if (!valueSwichLoading.value) {
        gkLoading.value = true


        if (nozzleList.value.length > 0) {
          for (let i in nozzleList.value) {


            setTimeout(() => {
              lazyLoadingData.value.push(nozzleList.value[i])
              console.log(nozzleList.value.length)
              if (i == nozzleList.value.length - 1) {
                gkLoading.value = false
              }
            }, 10)

          }
        } else if (nozzleList.value.length == 0) {

          gkLoading.value = false
          addActive();
          setTimeout(() => {
            for (let i in nozzleList.value) {


              setTimeout(() => {
                lazyLoadingData.value.push(nozzleList.value[i])
                console.log(nozzleList.value.length)
                if (i == nozzleList.value.length - 1) {
                  gkLoading.value = false
                }
              }, 10)

            }
            activeNameInside.value = 0;
          });
        }


      }

      valueSwichLoading.value = true

      let node = [];

      (await getNode()).forEach((v) => {

        if (v.classList.value.includes("left")) {
          node.push(v);
        }
      });

      Sortable.create(node[0], {
        animation: 150,
        delay: 0,
        // 结束拖拽后的回调函数
        onEnd: evt => {
          // ElMessage.warning('正在拖拽到指定位置请稍后...')
          let data = JSON.parse(JSON.stringify(lazyLoadingData.value))
          lazyLoadingData.value = []
          nozzleList.value = []

          nextTick(() => {

            const oldItem = data[evt.oldIndex];

            data.splice(evt.oldIndex, 1);

            data.splice(evt.newIndex, 0, oldItem);



            lazyLoadingData.value = data
            nozzleList.value = data
            activeNameInside.value = evt.newIndex;
            ElMessage.success('移动成功')
          })


        }
      })
    } else {
      hiddenButtonShow.value = false
    }


    if (tab.paneName == "静设备结构安装条件表") {
      getVelDataNet()
      showVelData.value = true
    } else {
      showVelData.value = false
    }
  };



  let getVelDataNet = async () => {
    let res = await GetVesselSupportDatasForSaddle({ equip_oid: equip_oid.value })
    if (Object.keys(res).length > 0) {
      vesselData.value = res
    } else {
      ElMessage.error('返回数据格式有误')
    }
  }


  let saveVelData = async () => {
    let obj = {
      ...vesselData.value,
      equip_oid: equip_oid.value,
      modify_user: JSON.parse(localStorage.getItem("userMessage")).user_name
    }
    obj.support_type = vesselData.value.support_type.split(',')[1]
    let res = await SaveVesselSupportDatasForSaddle(obj)
    if (res == 'True') {
      getVelDataNet()
      ElMessage.success('保存成功')
    } else {
      ElMessage.error('保存失败,请检查参数')
    }

  }

  let showVelData = ref(false)





  let getNode = () => {
    return new Promise((resolve, reject) => {
      let getNodeFn = () => {

        let node = document.querySelectorAll('.el-tabs__nav')

        if (node.length <= 1) {
          setTimeout(getNodeFn, 1000)

        } else {
          resolve(node)
        }

      }
      getNodeFn()
    })

  }

  const props = defineProps({
    data: {
      type: Array,
      default: [],
    },
  });

  let nozzleListdesignform = ref({});


  let activeNewName = ref("设备工艺参数");
  let vesselData = ref({
    full_volume: "",
    net_weight: "",
    lifting_weight: "",
    operating_weight: "",
    maximum_weight: "",
    support_type: "",
    support_count: 2,
    support_height: "",
    support_spacing: "",
    singlesupportbolt_material: "",
    singlesupportbolt_quantity: "",
    singlesupportbolt_spacing_l2: "",
    singlesupportbolt_spacing_l4: "",
    singlesupportbolt_specification: "",
    singlesupportbolt_cantilever_length: "",
    base_plate_l1: "",
    base_plate_b1: "",
    fluid_property: "",
    fluid_density: "",
    design_temperature: "",
    nominal_diam: "",
    tube_length: "",
    insulation_thickness: "",
    equip_dry_weight: "",
  });


  let sendTrue = ref(false)
  watch(() => vesselData.value.support_type, async () => {
    sendTrue.value = false
    document.querySelector('#message_my_id')?.remove()
    let value = vesselData.value.support_type.includes(',') ? vesselData.value.support_type.split(',') : vesselData.value.support_type == 'B-1' ? ['120'] : vesselData.value.support_type == 'A' ? ['120'] : vesselData.value.support_type == 'B-2' ? ['150'] : ['0'];

    if (designform.value.saddle_corner_radius !== value[0]) {
      let div = document.createElement('div')
      div.setAttribute('id', 'message_my_id')
      div.innerHTML = `<div class='message_my' style='color:red;position:absolute'>支座型号和鞍座包角不匹配</div>`
      document.querySelector('.contentMessage').append(div)

    } else {

      document.querySelector('#message_my_id')?.remove()
      sendTrue.value = true
    }

    let res = await GetSaddleDatas({
      saddleType: value[1],
      saddleAngle: value[0],
      dn: vesselData.value.nominal_diam
    })

    if (!res.data && Object.keys(res).length > 0) {
      for (let i in res) {
        vesselData.value[i] = res[i]
      }
    }

  })


  watch(() => designform.value.saddle_corner_radius, () => {
    sendTrue.value = false
    document.querySelector('#message_my_id')?.remove()
    let value = vesselData.value.support_type.includes(',') ? vesselData.value.support_type.split(',') : vesselData.value.support_type == 'B-1' ? ['120'] : vesselData.value.support_type == 'A' ? ['120'] : vesselData.value.support_type == 'B-2' ? ['150'] : ['0'];

    if (designform.value.saddle_corner_radius !== value[0]) {
      let div = document.createElement('div')
      div.setAttribute('id', 'message_my_id')
      div.innerHTML = `<div class='message_my' style='color:red;position:absolute'>支座型号和鞍座包角不匹配</div>`
      document.querySelector('.contentMessage')?.append(div)

    } else {
      document.querySelector('#message_my_id')?.remove()
      sendTrue.value = true
    }

  })


  let arrangeangleoptions = ref([]);
  let gaskettypeoptions = ref([]);
  let getOptionsGetStandardMetadatas = async () => {
    let res = await getStandardMetadatas();

    if (res) {
      standardoptions.value = res;
    }
  };

  let getRatingMetadatasOptions = async () => {
    let res = await getRatingMetadatas();

    if (res) {
      ratingoptions.value = res;
    }
  };

  let getGasketTypeMetadatasOptions = async () => {
    let res = await getGasketTypeMetadatas();

    if (res) {
      gaskettypeoptions.value = res;
    }
  };

  let plateisflangeoptions = ref([]);
  let getbooloptiondatasOptions = async () => {
    let res = await getbooloptiondatas();

    if (res) {
      plateisflangeoptions.value = res;
    }
  };

  let getArrangeAnglemetadatasOptions = async () => {
    let res = await getArrangeAnglemetadatas();

    if (res) {
      arrangeangleoptions.value = res;
    }
  };

  let nozzleList = ref([]);

  let valueSwich = ref(false);
  watch(valueSwich, () => {
    if (valueSwich.value) {
      activeName.value = "主体结构参数";
    } else {
      activeName.value = "基本体";
      valueSwichLoading.value = false
      lazyLoadingData.value = []
    }
    console.log('123123123')
    listOptions();
    getOptionsGetStandardMetadatas();
    getRatingMetadatasOptions();
    getGasketTypeMetadatasOptions();
    getbooloptiondatasOptions();
    getArrangeAnglemetadatasOptions();
    getBEMdesigndatasList();
    GetBEMNozzleDesignDatasList();
    getequipmentshapeData();
    GetEquipmentNozzleData();
  });

  // 计算外伸长度
  let CalExtensionLen = (nozzle) => {
    let nozzleOutsideExtensionLength = 0;

    if (
      nozzle.nozzle_location === "筒体" &&
      nozzle.nozzle_extended_bend === "Y"
    ) {

      nozzleOutsideExtensionLength =
        Math.abs(nozzle.nozzle_offset_dis) -
        Math.sqrt(
          Math.pow(nozzle.nozzle_open_diam / 2, 2) -
          Math.pow(nozzle.nozzle_bend_center_dis, 2)
        );
    }

    if (
      nozzle.nozzle_location === "筒体" &&
      nozzle.nozzle_extended_bend === "N"
    ) {

      nozzleOutsideExtensionLength =
        nozzle.nozzle_face_to_equip_center -
        Math.sqrt(
          Math.pow(nozzle.nozzle_open_diam / 2, 2) -
          Math.pow(nozzle.nozzle_offset_dis, 2)
        );
    }

    if (nozzle.nozzle_location !== "筒体") {
      const headOpenLocation = Math.sqrt(
        (1 -
          Math.pow(
            (Math.abs(nozzle.nozzle_offset_dis) / nozzle.nozzle_open_diam) * 2,
            2
          )) *
        Math.pow(nozzle.nozzle_open_diam / 4, 2)
      );
      nozzleOutsideExtensionLength =
        nozzle.nozzle_to_head_tangent_dis - headOpenLocation;
    }

    nozzle.nozzle_outside_extension_length = Math.round(
      nozzleOutsideExtensionLength
    );
    ElMessage({
      message: "计算外伸长度成功",
      type: "success",
    });
  };

  let activeNameInside = ref("");
  let GetBEMNozzleDesignDatasList = async () => {
    let res = await GetBEMNozzleDesignDatas({
      equip_oid: equip_oid.value,
    });

    // res.sort((n1, n2) => {
    //   if (n1.nozzle_name.toUpperCase() < n2.nozzle_name.toUpperCase()) return -1;
    //   if (n1.nozzle_name.toUpperCase() > n2.nozzle_name.toUpperCase()) return 1;
    //   return 0;
    // });
    nozzleList.value = res;

    if (nozzleList.value.length > 0) {
      activeNameInside.value = 0;
    } else {
      addActive();
      setTimeout(() => {
        activeNameInside.value = 0;
      });
    }
  };

  let getBEMdesigndatasList = async () => {
    let res = await GetVesselsDesignDatas({
      equip_oid: equip_oid.value,
    });
    console.log(res)
    if (res.length > 0) {
      designform.value = res[0];
    }
  };

  let reinforcingRingMeta = ref([]);
  let internalComponentMeta = ref([]);
  let connectTubeMaterialMeta = ref([]);
  let listOptions = async () => {
    let reinforcingRingMetas = await GetNozzleReinforcingRingMeta();

    reinforcingRingMeta.value = reinforcingRingMetas;
    let internalComponentMetas = await GetNozzleInternalComponentsMeta();
    internalComponentMeta.value = internalComponentMetas;
    let connectTubeMaterialMetas = await GetNozzleConnectTubeMaterialMeta();
    connectTubeMaterialMeta.value = connectTubeMaterialMetas;
  };

  let equip_oid = ref("");
  let showTotle = ref(false);
  let equipInfo = ref({});

  watch(showTotle, () => { });

  let GetEquipmentNozzleData = async () => {
    let res = await GetEquipmentNozzle({ equip_oid: equip_oid.value });
    if (res.length > 0) {
      nozzlesData.value = res;
    } else {
      nozzlesData.value = [];
    }
  };

  watch(
    props,
    () => {
      setTimeout(() => {
        showTotle.value = true;
      }, 100);
      designform.value.left_saddle_to_head_tangent_dist = 0
      equip_oid.value = sessionStorage.getItem("equip_oid");
      equipInfo.value = JSON.parse(sessionStorage.getItem(equip_oid.value));
      listOptions();
      getOptionsGetStandardMetadatas();
      getRatingMetadatasOptions();
      getGasketTypeMetadatasOptions();
      getbooloptiondatasOptions();
      getArrangeAnglemetadatasOptions();
      getBEMdesigndatasList();
      GetBEMNozzleDesignDatasList();
      getequipmentshapeData();
      GetEquipmentNozzleData();
    },
    { immediate: true }
  );

  let nozzlesData = ref([]);

  const buttonRef = ref();
  const popoverRef = ref();

  const removeTab = (targetName) => {
    ElMessageBox.confirm("确认删除？", "删除", {
      type: "warning",
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      buttonSize: "small",
    }).then(() => {
      try {
        DelBEMNozzleDesignDatasData({
          nozzle_oid: nozzleList.value[targetName].nozzle_oid,

          nozzle_index: nozzleList.value[targetName].nozzle_index,
        });

        if (targetName >= nozzleList.value.length - 1) {
          activeNameInside.value = 0;
        }

        nozzleList.value.splice(targetName, 1);
        lazyLoadingData.value = nozzleList.value
        if (!nozzleList.value[activeNameInside.value]) {
          activeNameInside.value--
        }
        ElMessage({
          type: "success",
          message: `删除成功`,
        });
      } catch (error) {
        console.log(nozzleList.value);
        console.log(error);
      }
    });
  };



  let copyFn_con = () => {
    if (nozzleList.value.length > 0) {
      document.querySelector('.hiddenButton').click()
    } else {
      ElMessage({
        type: 'error',
        message: '当前未选中'
      })
    }

  }


  let addActive2 = () => {
    active_num.value++;
    let nozzleData = JSON.parse(JSON.stringify(editedNozzleDatas));
    nozzleData.equip_oid = equip_oid.value;
    nozzleData.nozzle_name = `unName${active_num.value}`;
    nozzleList.value.push(nozzleData);

    lazyLoadingData.value = nozzleList.value

    if (nozzleList.value.length > 1) {
      //nozzleList.value.
      ElMessage({
        message: "新增管口成功",
        type: "success",
      });
    }

    activeNameInside.value = nozzleList.value.length - 1;
  };

  let createN = async () => {
    let res = await CreateNozzleMaterialListV2({ equip_oid: equip_oid.value })
    let blob = new Blob([res.data], {
      type: 'application/vnd.ms-excel; charset=utf-8'
    })

    let filename = res.headers;
    let filename2 = ""; //下载后文件名
    filename = filename["content-disposition"];
    filename = window.decodeURI(filename);
    filename2 = filename.split(";")[1].split("filename*=UTF-8''")[1];
    filename = filename.split(";")[1].split("filename=")[1];
    const link = document.createElement("a"); // 创建a标签
    const blo = new Blob([res.data], { type: res.data.type }); // 设置下载格式
    link.style.display = "none";
    const urls = window.URL.createObjectURL(blo);
    link.href = urls;
    if (filename == undefined) {
      filename = filename2;
    }
    let a = document.createElement('a')
    let url = window.URL.createObjectURL(blob)
    a.href = url
    a.download = filename
    document.body.appendChild(a)
    a.style.display = 'none'
    a.click()
    document.body.removeChild(a)
    window.URL.revokeObjectURL(url)



    ElMessage({
      message: "成功生成文件",
      type: "success",
    })
  }



  let tableViewData = ref([])
  let dialogVisibleviewExcel = ref(false)
  let viewExcel = async () => {
    dialogVisibleviewExcel.value = true
    let res = await CalNozzleMaterialListV2({ equip_oid: equip_oid.value })

    tableViewData.value = res
  }
  let tableSpanMethod = ({ rowIndex, columnIndex }) => {
    if (columnIndex === 0) {
      return {
        rowspan: spanTable(createSpanrowData(tableViewData.value, ["nozzleName"]), rowIndex).rowspan,
        colspan: spanTable(createSpanrowData(tableViewData.value, ["nozzleName"]), rowIndex).colspan,
      };
    }
  }
  const spanTable = (spanArr, rowIndex) => {
    if (spanArr !== null && spanArr.length > 0) {
      for (let j = 0; j < spanArr.length; j++) {
        for (let i = 0; i < spanArr[j].spanLength; i++) {
          // 如果当前行是构造好的合并行数据的开始行，则返回rowspan:合并数据的合并行数量
          if (rowIndex === spanArr[j].fromIndex) {
            return {
              rowspan: spanArr[j].spanLength,
              colspan: 1,
            };
          } else if (rowIndex > spanArr[j].fromIndex && rowIndex < spanArr[j].spanLength + spanArr[j].fromIndex) {
            // 如果当前行大于构造好的合并行数据的开始行，小于合并行数据的开始行+合并数据的合并行数量，则返回rowspan:0
            return {
              rowspan: 0,
              colspan: 1,
            };
          }
        }
      }
    }
  };

  const createSpanrowData = (paramData, propName) => {
    if (paramData !== null && paramData.length > 0) {
      let oneArr = [];
      let currentValue = "";
      let tempFromIndex = 0;
      let tempRowspan = 1;
      for (let i = 0; i < paramData.length; i++) {
        let tempValue = "";
        // 循环propName属性数组，拼接需要合并的级联连属性
        for (let j = 0; j < propName.length; j++) {
          tempValue += paramData[i][propName[j]];
        }
        if (currentValue === tempValue) {
          // 如果当前行与上一行列属性值相同，则合并行+1
          tempRowspan++;
        } else {
          // 如果当前行与上一行列属性值不同，则更新当前行数据，添加前一组的合并参数到数组中
          currentValue = tempValue;
          if (i !== 0) {
            oneArr.push({ fromIndex: tempFromIndex, spanLength: tempRowspan });
          }
          // 并重置合并行为默认值1，更新合并开始行为当前行i
          tempRowspan = 1;
          tempFromIndex = i;
        }
      }
      // 添加最后一组合并参数到数组中
      oneArr.push({ fromIndex: tempFromIndex, spanLength: tempRowspan });
      return oneArr;
    }
  };


  let changeName_G = (text) => { };

  let DelBEMNozzleDesignDatasData = async (data) => {
    if (data.nozzle_oid) {
      await DelBEMNozzleDesignDatas(data);
    }
  };

  let saveBEM = async () => {
    let num = JSON.parse(JSON.stringify(activeNameInside.value))
    // 检查管口号是否唯一
    const nozzleNames = nozzleList.value.map((item) => item.nozzle_name);
    if (nozzleNames.includes("")) {
      ElNotification({
        position: "top-right",
        title: "保存失败",
        message: `管口名称不能为空，请重新输入`,
        type: "error",
      });

      return;
    }

    const uniqueNozzleNames = [];
    const name = [];
    for (const nozzleName of nozzleNames) {
      if (!uniqueNozzleNames.includes(nozzleName)) {
        uniqueNozzleNames.push(nozzleName);
      } else {
        name.push(nozzleName);
      }
    }

    if (uniqueNozzleNames.length < nozzleNames.length) {
      ElNotification({
        position: "top-right",
        title: "保存失败",
        message: `${name.join(",")}管口名称重复，请重新输入`,
        type: "error",
      });

      return;
    }


    let bool = true

    try {
      await SaveVesselsDesignDatas({
        ...designform.value,
        Equip_oid: equip_oid.value,
        equip_oid: equip_oid.value
      });

      lazyLoadingData.value.forEach(async (v, i) => {
        v.equip_oid = equip_oid.value;
        await SaveNozzleDesignDatas({
          ...v,

          nozzle_index: i + 1
        });
      });
      bool = true
    } catch (err) {
      bool = false
    }
    console.log(designform.value)







    ElNotification({
      position: "top-right",
      title: "正在保存",
      message: `正在保存,请等待.....`,
      type: "success",
      duration: 3000,
      onClose: () => {

        if (bool) {
          ElNotification({
            position: "top-right",
            title: "保存成功",
            message: `保存成功`,
            type: "success",
          });

        } else {
          ElNotification({
            position: "top-right",
            title: "保存失败",
            message: `保存失败，请检查参数`,
            type: "error",
          });
        }

      },
    });

    setTimeout(() => {
      getBEMdesigndatasList();
      GetBEMNozzleDesignDatasList();
      getequipmentshapeData();
      GetEquipmentNozzleData();
      setTimeout(() => {

        activeNameInside.value = num

      }, 500)
    }, 2000);
  };

  let nozzleSch = [
    { label: "Sch.5S", value: "Sch.5S" },
    { label: "Sch.10S", value: "Sch.10S" },
    { label: "Sch.10", value: "Sch.10" },
    { label: "Sch.20", value: "Sch.20" },
    { label: "Sch.30", value: "Sch.30" },
    { label: "Sch.40S", value: "Sch.40S" },
    { label: "Sch.40", value: "Sch.40" },
    { label: "Sch.60", value: "Sch.60" },
    { label: "Sch.80S", value: "Sch.80S" },
    { label: "Sch.80", value: "Sch.80" },
    { label: "Sch.100", value: "Sch.100" },
    { label: "Sch.120", value: "Sch.120" },
    { label: "Sch.140", value: "Sch.140" },
    { label: "Sch.160", value: "Sch.160" },
  ];

  let modelParam = ref({
    // 模型参数控制
    nominal_dia: null,
    cylinder_thickness: null,
    head_thickness: null,
    cylinder_length: null,
    support_form: null,
  });

  let JCfN = (item) => {
    if (sessionStorage.getItem('diameter')) {
      ElMessage({
        message: "继承成功",
        type: "success",
      });

      item.nozzle_open_diam = sessionStorage.getItem('diameter');
    } else {
      ElMessage({
        message: "公称直径未填写，无法继承",
        type: "error",
      });
    }
  };

  let editedNozzleDatas = {
    nozzle_oid: "",
    equip_oid: "",
    nozzle_name: "",
    nozzle_npd: "",
    nozzle_unit: "",
    nozzle_rating: "",
    nozzle_standard: "",
    nozzle_form: "WN",
    nozzle_preparation: "RF",
    nozzle_face_to_equip_center: "",
    nozzle_purpose: "",
    nozzle_sch: "",
    nozzle_connect_or_reinforcing_tube: "",
    nozzle_connect_or_reinforcing_tube_thk: "",
    nozzle_outside_extension_length: "",
    nozzle_is_internal_extension: "N",
    nozzle_internal_extension_length: "",
    nozzle_offset_dis: "0",
    nozzle_open_angle: "0",
    nozzle_location: "",
    nozzle_normal_angle: "0",
    nozzle_to_head_tangent_dis: "",
    nozzle_ishide: "N",
    nozzle_with_blind: "N",
    nozzle_isneed_supp: "N",
    nozzle_note: "",
    nozzle_connect_tube_material: "",
    nozzle_extended_bend: "N",
    nozzle_bend_center_dis: "0",
    nozzle_internal_components: "无",
    nozzle_reinforcing_ring: "无",
    nozzle_reinforcing_ring_htk: "",
    nozzle_open_diam: "",
    nozzle_bend_offset_dis: "",
  };

  let active_num = ref(0);
  let addActive = () => {
    active_num.value++;
    let nozzleData = JSON.parse(JSON.stringify(editedNozzleDatas));
    nozzleData.equip_oid = equip_oid.value;
    nozzleData.nozzle_name = `unName${active_num.value}`;
    nozzleList.value.push(nozzleData);
    if (nozzleList.value.length > 1) {

      ElMessage({
        message: "新增管口成功",
        type: "success",
      });
    }
    activeNameInside.value = nozzleList.value.length - 1;
  };

  let copy_num = ref(0);
  let copyFn = (item) => {
    copy_num.value++;
    const activeNozzleData = item;
    const nozzleData = JSON.parse(JSON.stringify(activeNozzleData));
    nozzleData.nozzle_name = `Copy-${nozzleData.nozzle_name}`;
    nozzleData.nozzle_oid = "";
    nozzleList.value.push(nozzleData);
    lazyLoadingData.value = nozzleList.value
    ElMessage({
      message: `复制${nozzleData.nozzle_name}管口成功`,
      type: "success",
    });
    activeNameInside.value = nozzleList.value.length - 1;
  };

  let show1 = ref(true);
  let show2 = ref(false);
  let show3 = ref(false);
  let show4 = ref(false);
  let show5 = ref(false);
  let show6 = ref(false);
  let show7 = ref(false);
  let show8 = ref(false);
  let show9 = ref(false);
  watch(
    activeName,
    () => {
      store.activeNameStore = activeName.value;
      show1.value = true;
      show2.value = true;
      show3.value = true;
      show4.value = true;
      show5.value = true;
      show6.value = true;
      show7.value = true;
      show9.value = true;
    },
    { immediate: true }
  );

  let copyData = ref({})
  let cancelGo = () => {
    console.log(editedRowDatanozzles.value)
    editedRowDatanozzles.value = copyData.value
    innerVisible.value = false
  }
</script>

<style lang="scss" scoped>
  .header_title_right_switch {
    transition: all 0.3s;
    // position: absolute; left: 127px;
    // bottom: -4px;
  }

  .header_title_right_switch_r {
    transition: all 0.3s;
    // position: absolute; left: 100px;
    // bottom: -4px;
  }

  .inside_from_s {
    margin-top: 20px;

    margin-left: 10px;
  }

  ::v-deep(.el-divider--horizontal) {
    margin: 7px 0;
    margin-bottom: 27px;
  }

  ::v-deep(.el-form--inline .el-form-item) {
    margin-bottom: 18px !important;
    margin-right: 44px;
  }

  .button_footer {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    width: 100%;
  }

  .bottom_from_inside {
    min-height: 240px;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 10px;
  }

  .header_title {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
  }

  .flex_style {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }

  ::v-deep(.demo-tabs_ds .el-tabs__item) {
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
  }

  .common_button2 {
    position: absolute;
    top: 50px;
    right: 0;
  }

  .common_button {
    display: flex;
    visibility: hidden;
    align-items: center;

    position: absolute;
    right: 0px;
    top: 0px;
  }

  .content_tabs {
    min-height: 200px;
  }

  .bottom_from_inside {
    height: calc(100vh - 650px);
  }

  ::v-deep(.el-form-item__label) {
    padding: 0;
  }

  ::v-deep(.el-dialog__body) {
    .el-form-item__label {
      padding-left: 5px;
    }
  }

</style>